# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=openspecfun
pkgver=0.5.3
pkgrel=3
pkgdesc="A collection of special mathematical functions."
url="https://github.com/JuliaLang/openspecfun"
arch="all !s390x !mips64" # limited by openlibm
license="MIT Public-Domain"
makedepends="openlibm-dev gfortran"
options="!check" # no tests
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/JuliaLang/openspecfun/archive/v$pkgver.tar.gz
	openspecfun.pc
	"

build() {
	make USE_OPENLIBM=1 prefix=/usr
	sed "s/@VERSION@/$pkgver/" "$srcdir"/$pkgname.pc > $pkgname.pc
}

package() {
	make DESTDIR="$pkgdir" prefix=/usr install
	install -D $pkgname.pc "$pkgdir"/usr/lib/pkgconfig/$pkgname.pc
}

sha512sums="503da7592b126cce9ecb8af5ce16c667a9b022676721063e5f551fb88c0955f465ed66df7728ed2391f068ea14b77414bfd9934c0ee38081d11b998826d6b88a  openspecfun-0.5.3.tar.gz
4546252dbe5d4b563439047df1d75fadb73e00b0c6389220ae6f242f1aa0344e54f87dc9a86edca66779bcb07716bcd6a173178bff54d3aeeb48804cfda64e4d  openspecfun.pc"
